<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <!-- <meta name="viewport" content="width=device-width, initial-scale=1.0"> -->
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <title>Document</title>
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="./css/home_page.css">
    <link rel="stylesheet" href="./fonts/font_901371_pzqo1ww1sw/iconfont.css">
    <!-- 字体rem样式 -->
    <!-- <script src="../js/media.js"></script>
    <script src="../lib/zepto/zepto.js"></script> -->
    <script src="./lib/nprogress/nprogress.js"></script>
    <script src="./lib/jquery/jquery.js"></script>
    <script src="./lib/template/template.js"></script>
   
<!-- 菜单栏 -->
</head>
<body>
    <!-- 顶部通栏 -->
    <header>
        <!-- <div class="t-entryName">慢慢买</div> -->
        <div class="t-rebate">
            <!-- <div>全网比价.折扣</div>
            <div>m.manmanbuy.com</div> -->
            <img src="./images/header_logo.png" alt="">
        </div>
        <div class="t-app"><img src="../images/header_app.png" alt=""></div>
    </header>
    <!-- 搜索框 -->
    <div class="t-search">
        <input type="text" value="请输入你想比价的商品">
        <input type="button" value="搜索">
    </div>
    <!-- 菜单栏 -->
    <div class="t-menu">
         <ul class="t-menuLi clearfix">
            
        </ul> 
    </div> 
    <!-- 超值折扣推荐 -->
    <div class="t-groom-rebate">
        <div class="t-top">
            <div>超值折扣推荐</div>
            
            <div>
                <a href="javascript:;">
                    <span></span>
                </a>
            </div>
            
        </div>
        <div class="t-ware">
            <ul class="t-wareul">
                <!-- <li>
                    <a href="javascript:;">
                        <img src="./images/gengduo.png" alt="">
                        <div class="t-ware-name">
                            <div>移动端凑单品：海天 鲜味 生抽1.28L
                                <span>10.9元</span>    
                            </div>
                            <div>
                                <span>京东商城</span>
                                <span>10-25 14:10</span>
                            </div>
                        </div>
                    </a>
                </li>
                <li></li> -->
            </ul>
        </div>
    </div>
    <!-- 查看更多 -->
    <div class="t-lookmore">
        <div>更多优惠信息
            <span></span>
            <span></span>
        </div>
    </div>
    <!-- 品牌排行 -->
    <div class="t-brand">
            <div>品牌排行</div>
            
            <div>
                <a href="javascript:;">
                    <span></span>
                </a>
            </div>
            
    </div>
    <!-- 底部 -->
    <footer>
            <!-- 底部工具栏 -->
            <div class="footer-tools">
              <a href="javascript:;">登录</a>
              <a href="javascript:;">注册</a>
              <a href="javascript:;">返回顶部</a>
            </div>
            <!-- 版权信息 -->
            <div class="footer-copyright">
              <p>
                <a href="javascript:;">手机APP下载</a>
                慢慢买手机版 
                <span>-- 掌上比价平台</span>
              </p>
              <p>m.manmanbuy.com</p>
            </div>
    </footer>
        
    <!-- <p>春暖花开</p>
    <p>春暖花开</p>
    <p>春暖花开</p>
    <p>春暖花开</p>
    <p>春暖花开</p>
    <p>春暖花开</p>

    <p>春暖花开</p>
    <p>春暖花开</p><p>春暖花开</p>
    <p>春暖花开</p>
    <p>春暖花开</p>
    <p>春暖花开</p>

    <p>春暖花开</p>
    <p>春暖花开</p> -->
</body>
</html>

<!-- 菜单栏数据渲染 -->
<script  type="text/template" id="menutemp">
    {{each result as val key}}
        
            <li  data-id="{{val.indexmenuId}}"><a href="{{val.titlehref}}"> {{val.img}}  <p>{{val.name}}</p></a></li>
        
    {{/each}}
</script>

<!-- 超值折扣推荐数据渲染 -->
<script type="text/template" id="rebatetemp">
        {{each result as val key}}
            <li>
                <a href="javascript:;">
                    {{val.productImgSm}}
                    <div class="t-ware-name">
                        <div>{{val.productName}}
                            <span>{{val.productPinkage}}</span>    
                        </div>
                        <div>
                            <span>{{val.productFrom}}</span>
                            <span>{{val.productTime}}</span>
                            <span class="iconfont icon-navicon-dxgl"></span>
                        </div>
                    </div>
                </a>
            </li>
        {{/each}}
</script>

<script>
  

    //菜单栏数据请求
    $.ajax({
        type:'get',
        url:'http://193.112.55.79:9090/api/getindexmenu',
        dataType:'json',
        success:function(res){
            // console.log(res);
            template.config("escape", false); 
            var htmlstr=template('menutemp',res);
            $('.t-menuLi').html(htmlstr);
            var lis=document.querySelectorAll('li');
              //点击菜单栏更多 出现第三排菜单
                var flag=false;
                lis[7].onclick=function(){
                    flag=!flag;
                    for(var i=0;i<lis.length;i++){
                        if(i>7){
                            if(flag){
                                lis[i].style.display='block';
                            }else {
                                lis[i].style.display='none';
                            }
                        }
                    }
                }
        }
    })
    // var lis;
    //超值折扣推荐数据请求
    $.ajax({
        type:'get',
        url:'http://193.112.55.79:9090/api/getmoneyctrl',
        dataType:'json',
        success:function(res){
            // console.log('res----->',res);
            template.config("escape", false); 
            var htmlstr=template('rebatetemp',res);
            // console.log($(res.result));
            
            $('.t-wareul').html(htmlstr);
           
        }
    })

     

 
      
  
</script>
